var inputs=document.querySelectorAll('input')
var loginBtn=document.querySelector('button')

loginBtn.onclick=()=>{
    axios.post('/user/login',{phone:inputs[0].value,pass:inputs[1].value}).then((res)=>{
        if(res.data.code==200){

            localStorage.setItem('token',res.data.token)
            localStorage.setItem('userinfo',JSON.stringify(res.data.userinfo))

            alert('登录成功')
            location.href='./index.html'
        }else{
            alert('登录失败')
        }
    })
}